import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/Home'
import Notfound from '@/views/Notfound' // 404
import _Index from '@/views/Index' // 测试
const _import = require('./_import_' + process.env.NODE_ENV)
Vue.use(Router)

export default new Router({
  base: '/be/',
  mode: 'history',
  routes: [
    {
      path: '/index',
      name: 'index',
      component: _Index
    },
    {
      path: '/login',
      name: 'Login',
      component: _import('login')
    },
    {
      path: '/home',
      component: Home,
      children: [
        {
          path: 'mark-page/*',
          name: 'mark-page',
          component: _import('MarkPage'),
          meta: {
            title: '标注'
          }
        },
        {
          path: 'create-batch/*',
          name: 'create-batch',
          component: _import('CreateBatch'),
          meta: {
            title: '创建批次'
          }
        },
        {
          path: 'marktask-detail/*',
          name: 'marktask-detail',
          component: _import('MarktaskDetail'),
          meta: {
            title: '标注任务详情'
          }
        },
        {
          path: 'myintegral-detail/*',
          name: 'myintegral-detail',
          component: _import('MyintegralDetail'),
          meta: {
            title: '我的积分详情'
          }
        },
        {
          path: 'result-page/*',
          name: 'result-page',
          component: _import('ResultPage'),
          meta: {
            title: '查看结果'
          }
        },
        {
          path: 'create-medal/*',
          name: 'create-medal',
          component: _import('CreateMedal'),
          meta: {
            title: '创建勋章'
          }
        },
        {
          path: 'export-page/*',
          name: 'export-page',
          component: _import('Export'),
          meta: {
            title: '导出页面'
          }
        }
      ]
    },
    {
      path: '*',
      component: Notfound,
      meta: {
        title: '找不到此页面'
      }
    }
  ]
})
